from qiniu import Auth
from torch.distributed.elastic.timer import expires

class Qiniu():
    def __init__(self):
        self.access_key = 'cIZQnBWJ7ek5iCrE1UnwSg7qBiWaYBLWT5mEcFcX'
        self.secret_key = 'iUW62sUbBE-r0mLEX8Tk_RIT7C_k1DGd864CSik-'

    def qiniu_token(self):
        q=Auth(self.access_key, self.secret_key)

        #要上传的空间
        bucket_name = 'zzzllzz'
        expires = 3600
        #生成上传 Token，可以指定过期时间等
        token= q.upload_token(bucket_name,expires=expires )
        return token

q=Qiniu()